<form th:action="@{/admin/c/resource/add.gsp}" id="addForm" role="form" class="form-horizontal" action="#" method="post">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">新增资源信息</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-xs-12">
				<input th:value="${parentId}" name="parentId" type="hidden" />
				<div class="form-group">
					<label class="col-xs-3 control-label"><label class="text-danger">*</label> 资源类型： </label>
					<div class="col-xs-7">
						<select class="form-control" name="type">
							<option value="1">菜单</option>
							<option value="2">按钮</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label"><label class="text-danger">*</label> 资源名称： </label>
					<div class="col-xs-7">
						<input name="resourceName" placeholder="请输资源名称" type="text" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label"><label class="text-danger">*</label> 资源标志： </label>
					<div class="col-xs-7">
						<input name="permission" placeholder="请输资源标志" type="text" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label">资源URI：</label>
					<div class="col-xs-7">
						<input name="permValue" placeholder="请输资源URI" type="text" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label">资源代码：</label>
					<div class="col-xs-7">
						<input name="codeNum" placeholder="请输资源代码" type="text" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label">icon名称：</label>
					<div class="col-xs-7">
						<input name="iconCls" placeholder="请输icon名称" type="text" class="form-control" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label"><label class="text-danger">*</label> 排序： </label>
					<div class="col-xs-7">
						<input class="form-control" value="0" placeholder="请输入排序" type="text" name="sortOrder" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label">资源简介：</label>
					<div class="col-xs-7">
						<textarea class="form-control" placeholder="最多输入140字" name="description"></textarea>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn btn-primary" type="submit">
			<strong>提 交</strong>
		</button>
		<button type="button" class="btn btn-default" data-dismiss="modal">
			<strong>关 闭</strong>
		</button>
	</div>
</form>
<script th:inline="javascript">
    /*<![CDATA[*/
    $(function() {
        var rules = {
            resourceName : {
                required : true,
                maxlength : 20
            },
            permission : {
                required : true,
                maxlength : 50
            },
            permValue : {
                maxlength : 100
            },
            code : {
                maxlength : 80
            },
            iconCls : {
                maxlength : 30
            },
            sortOrder : {
                required : true,
                max : 99
            },
            description : {
                maxlength : 140
            }
        }
        var messages = {

        }
        tg_baseFormAjaxSubmit("addForm", rules, messages, function() {
            location.href = /*[[@{/admin/c/resource/list.gsp}]]*/'';
        });
    });
    /*]]>*/
</script>